pub use sea_orm_migration::prelude::*;

// Add each migration file as a module
mod m20240806_000001_create_account_group;
mod m20240806_000001_create_account_group_user;
mod m20240806_000001_create_request_map_table;
mod m20240806_000001_create_role_table;
mod m20240806_000001_create_user_active_token;
mod m20240806_000001_create_user_role_table;
mod m20240806_000001_create_user_table;

pub struct Migrator;

#[async_trait::async_trait]
impl MigratorTrait for Migrator {
    fn migrations() -> Vec<Box<dyn MigrationTrait>> {
        // The data table creation sequence matters.
        // The table holds the columns which being referenced must be created first.
        vec![
            Box::new(m20240806_000001_create_request_map_table::Migration),
            Box::new(m20240806_000001_create_account_group::Migration),
            Box::new(m20240806_000001_create_user_table::Migration),
            Box::new(m20240806_000001_create_role_table::Migration),
            Box::new(m20240806_000001_create_user_role_table::Migration),
            Box::new(m20240806_000001_create_account_group_user::Migration),
            Box::new(m20240806_000001_create_user_active_token::Migration),
        ]
    }
}
